package com.decent.manager.config.oss;

import com.decent.common.oss.config.AbstractOssConfig;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author: decent Gjh
 * @date: 2022/10/24/14:24
 * @description:
 */
@Configuration
@Component("OssConfig")
@Getter
@Setter
@ConfigurationProperties(prefix = "oss")
public class OssConfiguration extends AbstractOssConfig {
    /**
     * 阿里云账号id
     */
    private String accessKeyId;
    /**
     * 阿里云账号密钥
     */
    private String accessKeySecret;
    /**
     * 对象存储oss外网endpoint
     */
    private String endPoint;
    /**
     * 存储空间
     */
    private String bucketName;
    /**
     * 存储根目录
     */
    private String basePath;

    /**
     * 对象存储oss公共endpoint
     */
    private String publicEndPoint;
    /**
     * 对象存储oss内网endpoint
     */
    private String innerEndPoint;

    @Override
    public void init() {
        super.setAccessKeyId(accessKeyId);
        super.setAccessKeySecret(accessKeySecret);
        super.setBucketName(bucketName);
        super.setBasePath(basePath);
        super.setEndPoint(endPoint);
        super.setInnerEndPoint(innerEndPoint);
        super.setPublicEndPoint(publicEndPoint);
    }
}
